﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThanhTu.GNC.Media.KQXS.DataAccess.DAL;
using ThanhTu.GNC.Media.KQXS.DataAccess.DO;
using System.Data;

namespace ThanhTu.GNC.Media.KQXS.DataAccess.BL
{
    public class BreakingNewsBL : IDisposable
    {
        private BreakingNewsDAL vBreakingNewsDAL = null;
        private bool disposed = false;
        public BreakingNewsBL()
        {
            if (vBreakingNewsDAL == null)
            {
                vBreakingNewsDAL = new BreakingNewsDAL();
            }
        }
        ~BreakingNewsBL() { Dispose(false); }

        #region IDisposable Members

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (vBreakingNewsDAL != null)
                    {
                        vBreakingNewsDAL.Dispose();
                        vBreakingNewsDAL = null;
                    }
                }

                disposed = true;
            }
        }

        #endregion


        public int SaveNews(BreakingNewsDO vBreakingNewsDO) { return vBreakingNewsDAL.SaveNews(vBreakingNewsDO); }
        public int UpdateNews(BreakingNewsDO vBreakingNewsDO) { return vBreakingNewsDAL.UpdateNews(vBreakingNewsDO); }
        public int DeleteNews(int NewID) { return vBreakingNewsDAL.DeleteNews(NewID); }
        public List<BreakingNewsDO> SelectAll() { return vBreakingNewsDAL.SelectAll(); }
        public DataTable selectAll_Page(int pageIndex, int pageSize, ref int rowCount) { return vBreakingNewsDAL.selectAll_Page(pageIndex, pageSize, ref  rowCount); }
        public BreakingNewsDO getbyAwards(int NewID) { return vBreakingNewsDAL.getbyNews(NewID); }
        public DataTable selectAll_groupnews(int groupid, int pageIndex, int pageSize, ref int rowCount) { return vBreakingNewsDAL.selectAll_groupnews(groupid, pageIndex, pageSize, ref  rowCount); }
    }
}
